﻿using System;
using System.Collections.Generic;
using System.Text;

using Microsoft.VisualStudio;
using Microsoft.VisualStudio.Package;
using Microsoft.VisualStudio.TextManager.Interop;
using Microsoft.VisualStudio.OLE.Interop;


namespace DLanguagePackage
{
    class DLanguageService : LanguageService
    {
        LanguagePreferences languagePreferences;
        DScanner scanner;

        /// <summary>
        /// use base language preferences class. derive my own if i need more preferences
        /// </summary>
        /// <returns></returns>
        public override LanguagePreferences GetLanguagePreferences()
        {
            if (languagePreferences == null)
            {
                languagePreferences = new LanguagePreferences(this.Site, typeof(DLanguageService).GUID,
                    this.Name);
                languagePreferences.Init();
            }
            return languagePreferences;
        }

        public override IScanner GetScanner(IVsTextLines buffer)
        {
            if (scanner == null)
            {
                scanner = new DScanner();
            }
            return scanner;
        }

        public override string Name
        {
            //TODO obtain from resource file
            get { return "D Programming Language"; }
        }

        public override AuthoringScope ParseSource(ParseRequest req)
        {
            throw new NotImplementedException();
        }

        public override string GetFormatFilterList()
        {
            throw new NotImplementedException();
        }
    }
}
